<template>
  <div class="content" v-if="!skeleton">
    <!-- 轮播图 -->
    <van-swipe :autoplay="3000">
      <van-swipe-item v-for="(image, index) in focusList" :key="index">
        <img v-lazy="image" />
      </van-swipe-item>
    </van-swipe>
    <!-- 政策选项 -->
    <div class="policyDesBox">
      <div
        class="policeDes"
        v-for="(item, index) in policyDescList"
        :key="index"
      >
        <img class="icon" :src="item.icon" />
        {{ item.desc }}
      </div>
    </div>
    <!-- kingKongModule -->
    <div class="kingKongBox">
      <a
        class="kingKongItem"
        v-for="(item, index) in kingKongList"
        :key="index"
        :href="item.schemeUrl"
      >
        <img :src="item.picUrl" alt="" />
        <span class="text">{{ item.text }}</span>
      </a>
    </div>
    <!-- 广告推广页面 -->
    <div class="bigPromotionBox">
      <div
        class="content"
        v-for="(item, index) in bigPromotion"
        :key="index"
        :class="item.cells.length > 1 ? 'two' : 'one'"
      >
        <div class="promotionContent" v-for="(img, i) in item.cells" :key="i">
          <a :href="img.schemeUrl">
            <img :src="img.picUrl" />
          </a>
          <div class="title" v-if="img.title.length !== 0">
            <h3>{{ img.title }}</h3>
            <h4>{{ img.subTitle }}</h4>
          </div>
        </div>
      </div>
    </div>
    <!-- indexActivityModule -->
    <div class="indexActivityBox">
      <div class="bigTitle">新人专享礼</div>
      <div class="content">
        <div class="leftBox">
          <div class="leftTitle">新人专享礼包</div>
          <div class="imgBox">
            <a href="https://act.you.163.com/act/pub/qAU4P437asfF.html">
              <img
                src="//yanxuan.nosdn.127.net/352b0ea9b2d058094956efde167ef852.png"
                alt=""
              />
            </a>
          </div>
        </div>
        <div class="rightBox">
          <a
            :href="item.targetUrl"
            class="indexActivityItem"
            v-for="(item, index) in indexActivityList"
            :key="index"
          >
            <div class="desc">
              <span class="title">{{ item.title }}</span>
              <span class="subTitle">{{ item.subTitle }}</span>
              <span class="tag">{{ item.tag }}</span>
            </div>
            <div class="imgBox">
              <img v-lazy="item.showPicUrl" class="theImg" />
            </div>
            <div class="priceBox">
              <span class="originPrice">{{ item.originPrice }}</span>
              <span class="activityPrice">{{ item.activityPrice }}</span>
            </div>
          </a>
        </div>
      </div>
    </div>
    <!-- 类目热销榜 -->
    <div class="categoryHotSellModule">
      <div class="hotSellTitle">{{ categoryHotSellModule.title }}</div>
      <div class="content">
        <div
          class="hotSellBox"
          v-for="(item, index) in categoryHotSellModule.categoryList"
          :key="index"
          :class="index < 2 ? 'bigModule' : ''"
        >
          <div class="subTitle">{{ item.categoryName }}</div>
          <a :href="item.targetUrl" class="imgBox">
            <img v-lazy="item.showPicUrl" />
          </a>
        </div>
        <div class="hotSellBox empty"></div>
        <div class="hotSellBox empty"></div>
      </div>
    </div>
    <!-- sceneLightShoppingGuideModule -->
    <div class="shoppingGuideModule">
      <div
        class="shoppingGuideBox"
        v-for="(item, index) in sceneLightShoppingGuideModule"
        :key="index"
      >
        <div class="title" :style="{ color: '#' + item.styleItem.titleColor }">
          {{ item.styleItem.title }}
        </div>
        <div class="desc" :style="{ color: '#' + item.styleItem.descColor }">
          {{ item.styleItem.desc }}
        </div>
        <a :href="item.styleItem.targetUrl">
          <span
            class="imgBox"
            v-for="(pic, i) in item.styleItem.picUrlList"
            :key="i"
          >
            <img v-lazy="pic" />
          </span>
        </a>
      </div>
    </div>
  </div>
</template>

<script>
export default {};
</script>

<style lang="less" scoped>
  .content {
    background: #eeeeee;
    .van-swipe {
      background: #fff;
      padding-top: 2rem;
      height: 4rem;
      .van-swipe__track {
        .van-swipe-item {
          position: relative;
          img {
            position: absolute;
            width: 100%;
            top: -50%;
            transform: translateY(30%);
          }
        }
      }
      .van-swipe__indicators {
        bottom: 0.4rem;
        .van-swipe__indicator {
          width: 0.6rem;
          height: 0.06rem;
          border-radius: 0;
          &.van-swipe__indicator--active {
            background: #fff;
          }
        }
      }
    }
    .policyDesBox {
      display: flex;
      justify-content: space-around;
      padding: 0 0.1rem;
      background: #fff;
      .policeDes {
        height: 1rem;
        line-height: 1rem;
        .icon {
          vertical-align: middle;
          width: 0.4rem;
          margin-right: 0.01rem;
        }
      }
    }
    .kingKongBox {
      padding: 0 0.1rem;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      background: #fff;
      .kingKongItem {
        padding: 0 0.15rem;
        padding-bottom: 0.3rem;
        color: #333;
        text-align: center;
        img {
          width: 1.5rem;
        }
        .text {
          display: block;
        }
      }
    }
    .bigPromotionBox {
      background: #fff;
      margin-bottom: 0.3rem;
      padding: 0.2rem 0;
      .content {
        background: #fff;
        display: flex;
        justify-content: space-between;
        &.two {
          padding: 0 0.3rem;
          .promotionContent {
            width: 49%;
            img {
              width: 100%;
            }
          }
        }
        .promotionContent {
          width: 100%;
          position: relative;
          img {
            width: 100%;
          }
          .title {
            position: absolute;
            top: 0.2rem;
            left: 0.2rem;
            h3 {
              font-size: 0.38rem;
              text-align: center;
            }
            h4 {
              color: rgb(128, 55, 211);
              font-weight: normal;
            }
          }
        }
      }
    }
    .indexActivityBox {
      background: #fff;
      margin-bottom: 0.3rem;
      .bigTitle {
        width: 3.2rem;
        margin: auto;
        text-align: center;
        height: 1rem;
        line-height: 1rem;
        font-size: 0.43rem;
        position: relative;
        &::before {
          content: "";
          width: 0.3rem;
          height: 0.04rem;
          background: #000;
          position: absolute;
          top: 50%;
          left: 0;
        }
        &::after {
          content: "";
          width: 0.3rem;
          height: 0.04rem;
          background: #000;
          position: absolute;
          top: 50%;
          right: 0;
        }
      }
      .content {
        background: #fff;
        display: flex;
        padding: 0.4rem;
        padding-top: 0;
        .leftBox {
          width: 4.8rem;
          background: #f9e9cf;
          border-radius: 0.1rem;
          margin-right: 0.05rem;
          .imgBox {
            width: 3.6rem;
            margin: 0 auto;
            padding-top: 0.25rem;
            img {
              width: 100%;
            }
          }
          .leftTitle {
            font-size: 0.4rem;
            height: 1.2rem;
            line-height: 1.2rem;
            text-align: center;
          }
        }
        .rightBox {
          .indexActivityItem {
            position: relative;
            box-sizing: border-box;
            display: block;
            width: 4.6rem;
            height: 2.8rem;
            background: #fbe2d3;
            color: #333;
            border-radius: 0.1rem;
            &:last-child {
              background: #ffecc2;
              margin-top: 0.05rem;
            }
            .desc {
              position: absolute;
              top: 10%;
              left: 10%;
              z-index: 2;
              span {
                display: block;
              }
              .title {
                font-size: 0.45rem;
                padding-bottom: 0.1rem;
              }
              .subTitle {
                color: #7f7f7f;
              }
              .tag {
                background: #cbb693;
                border-radius: 0.04rem;
                color: #fff;
                font-size: 0.3rem;
                line-height: 0.4rem;
                padding: 0 0.1rem;
                text-align: center;
              }
            }
            .imgBox {
              position: absolute;
              right: 0;
              bottom: 0;
              .theImg {
                display: block;
                right: 0;
                width: 2.5rem;
              }
            }
            .priceBox {
              position: absolute;
              top: 0.15rem;
              right: 0.3rem;
              box-sizing: border-box;
              width: 1.1rem;
              height: 1.1rem;
              background: #f59524;
              color: #fff;
              padding-top: 0.1rem;
              text-align: center;
              border-radius: 0.55rem;
              span {
                display: block;
              }
              .activityPrice {
                text-decoration: line-through;
              }
            }
          }
        }
      }
    }
    .categoryHotSellModule {
      background: #fff;
      margin-bottom: 0.3rem;
      padding-top: 0.1rem;
      padding-bottom: 0.2rem;
      width: 100%;
      .hotSellTitle {
        width: 3.2rem;
        margin: auto;
        text-align: center;
        height: 1rem;
        line-height: 1rem;
        font-size: 0.43rem;
      }
      .content {
        background: #fff;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        padding: 0 0.4rem;
        .hotSellBox {
          width: 2.2rem;
          height: 2.4rem;
          background: #f5f5f5;
          border-radius: 0.08rem;
          margin-bottom: 0.08rem;
          margin-right: 0.08rem;
          &.empty {
            background: #fff;
          }
          .subTitle {
            margin-top: 0.2rem;
            font-size: 0.22rem;
            text-align: center;
          }
          .imgBox {
            display: block;
            margin: auto;
            width: 1.5rem;
            height: 1.5rem;
            img {
              width: 100%;
            }
          }
        }
        .hotSellBox.bigModule {
          width: 4.52rem;
          background: #ebeff6;
          position: relative;
          .subTitle {
            position: absolute;
            top: 40%;
            left: 10%;
            transform: translateY(-50%);
            margin-top: 0.2rem;
            font-size: 0.38rem;
            text-align: center;
            &::after {
              content: "";
              position: absolute;
              bottom: -30%;
              left: 0;
              width: 0.5rem;
              height: 0.05rem;
              background: #333;
            }
          }
          .imgBox {
            position: absolute;
            bottom: 0;
            right: 0;
            display: block;
            margin: auto;
            width: 2.4rem;
            height: 2.4rem;
            img {
              width: 100%;
            }
          }
          &:first-child {
            background: #f9f3e4;
          }
        }
      }
    }
    .shoppingGuideModule {
      display: flex;
      justify-content: space-between;
      background: #fff;
      padding: 0.2rem 0.4rem 0.4rem 0.4rem;
      margin-bottom: 0.3rem;
      .shoppingGuideBox {
        background: #eeeeee;
        width: 4.17rem;
        padding: 0.2rem;
        .title {
          font-size: 0.4rem;
          padding-left: 0.2rem;
          height: 0.6rem;
          line-height: 0.6rem;
        }
        .desc {
          padding-left: 0.2rem;
        }
        a {
          width: 0.2rem;
          margin: 0 0.05rem;
          .imgBox {
            img {
              width: 2rem;
            }
          }
        }
      }
    }
  }
</style>